<!--适用性模板-->
<template>
<div class="content"> 
        <Back></Back>
		<Battery></Battery>
		<Title v-bind:hasHelp="false" v-bind:title="title"></Title>
		<div class="spare-a">
			<div class="questions-ar">
				<div class="spare-ara">
					<div class="spare-ara-a clearfix">
						<div class="spare-ara-al">
							<div class="spare-ara-all"><input type="text" placeholder="请输入关键字" name="name" v-model="name" /></div>
							<div class="spare-ara-alr" @click="getData(name)"></div>
						</div>
						<div class="spare-ara-ar">
							<a href="#" class="spare-tj" @click="ok">确 定</a>
							<a href="#" class="spare-qx" sel="Y" style="display:none" hid='Y' @click="all">全 选</a>
							<a href="#" class="spare-del" style="display:none" hid='Y' @click="del">删 除</a>
						</div>
					</div>
					<div class="documentation">
						<ul>
								<li :class="{active:sel}"  @contextmenu.prevent="sel=!sel" v-for="adapt in adapts" :key="adapt.id"> 
									<div class="paper-a">产品：{{adapt.dmTitle}} - {{adapt.name}}</div>
								    <div class="documentation-check"></div>
								</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
</div>
</template>

<script>
import Battery from '@/components/Battery'
import Title from '@/components/Title'
import Back from '@/components/Back'
export default {
  name: 'Adapt',
  components:{
    Battery,
	Title,
	Back
  },
  data () {
    return {
		 name:'',
		 sel:false,
     title: '',
     pid: '',//父页面获取到的值
     isInit: true,
     folders: [],
		 files: [],
		 adapts: [],
		 ids:[]
    }
  },methods:{
     getData:function(name){
      //渲染左侧数据
      this.axios.get("/ietm/adapt",{params:{name:name}}).then(res=>{
        this.adapts=res.data;
      });
	  },ok:function(){//点击确定将选中数据保存到session过滤dm数据

		}
  },created(){
    this.isInit=true;
  },
  beforeRouteLeave(to,from,next){
    if(to.name==='Ietm'){
     this.isInit=true;
    }
	next();
 },activated() {//缓存被触发时
 	if(this.$route.params.id)
  	this.pid=this.$route.params.id;
  	if(this.$route.params.title)
	this.title=this.$route.params.title;
	if(this.isInit){
		this.getData('');
		this.isInit=false;
	}
} 
  
}
</script>

<style scoped>
@import url('../../assets/css/content.css');
@import url('../../assets/css/animation.css');
</style>
